################################################
#
# Events for The Ottomans
#
# ID 40000 - 49999 is reserved
#
#
#################################################
#
# Written by Sara Wendel-rtqvist

### Sultan Selim III deposed by Janissary Revolt ###
country_event = {
	id = 40000
	title = "EVTNAME40000"
	desc = "EVTDESC40000"
	
	major = yes
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1807
		NOT = {
			has_country_flag = sultan_mustafa_iv_flag
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	option = {
		name = "EVTOPTA40000"
		set_country_flag = sultan_mustafa_iv_flag
	}
}

### Mustafa IV ###
country_event = {
	id = 40001
	title = "EVTNAME40001"
	desc = "EVTDESC40001"
	
	major = yes
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		has_country_flag = sultan_mustafa_iv_flag
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	option = {
		name = "EVTOPTA40001"
		prestige = 10
		remove_leader = 63025
		add_leader = 63023
		define_ruler = {
			name = "Sultan Mustafa IV"
			picture = "TUR_MustafaIV"
			MIL = 6
			DIP = 5
			ADM = 6
		}
	}
}

### Mahmud II - saved by slave girl Cevri ###
country_event = {
	id = 40002
	title = "EVTNAME40002"
	desc = "EVTDESC40002"
	
	major = yes
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1808
		has_country_flag = sultan_mustafa_iv_flag
		NOT = {
			has_country_flag = sultan_mahmud_ii_flag
		}
	}
	
	mean_time_to_happen = {
		days = 30
	}
	
	option = {
		name = "EVTOPTA40002"
		clr_country_flag = sultan_mustafa_iv_flag
		set_country_flag = sultan_mahmud_ii_flag
		prestige = 20
		define_ruler = {
			name = "Sultan Mahmud II"
			picture = "TUR_MahmudII"
			MIL = 7
			DIP = 6
			ADM = 9
		}
		add_leader = 63017
		remove_leader = 63023
	}
}

### Nizam-i Cedid ###
country_event = {
	id = 40010
	title = "EVTNAME40010"
	desc = "EVTDESC40010"
	
	major = yes
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		exists = GBR
		exists = FRA
		NOT = {
			has_country_flag = sultan_mustafa_iv_flag
		}
		NOT = {
			has_country_flag = sultan_mahmud_ii_flag
		}
		NOT = {
			has_country_modifier = nizam_i_cedid
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	option = {
		name = "EVTOPTA40010"
		add_country_modifier = {
			name = nizam_i_cedid
			duration = 365
		}
		if = {
			limit = {
				NOT = {
					war_with = GBR
				}
			}
			relation = {
				who = GBR
				value = 20
			}
		}
		if = {
			limit = {
				NOT = {
					war_with = FRA
				}
			}
			relation = {
				who = FRA
				value = 20
			}
		}
	}
}

### Ottoman classical music ###
country_event = {
	id = 40020
	title = "EVTNAME40020"
	desc = "EVTDESC40020"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		NOT = {
			has_country_flag = sultan_mustafa_iv_flag
		}
		NOT = {
			has_country_flag = sultan_mahmud_ii_flag
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	option = {
		name = "EVTOPT_OK"
		idea_points = 50
	}
}

### Sima Milutinovic Sarajlija ###
country_event = {
	id = 40030
	title = "EVTNAME40030"
	desc = "EVTDESC40030"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1811
		1028 = {
			controlled_by = TUR
			owned_by = TUR
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	option = {
		name = "EVTOPTA40030"
		idea_points = 50
	}
}

### Ali Pasha and Lord Byron ###
country_event = {
	id = 40040
	title = "EVTNAME40040"
	desc = "EVTDESC40040"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1809
		NOT = {
			year = 1813
		}
		1070 = { #Ioaninna
			controlled_by = TUR
			owned_by = TUR
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	option = {
		name = "EVTOPT_OK"
		prestige = -10
	}
}

### Alemdar Mustafa Pasha ###
country_event = {
	id = 40050
	title = "EVTNAME40050"
	desc = "EVTDESC40050"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		had_country_flag = {
			days = 365
			flag = sultan_mahmud_ii_flag
		}
		any_owned_province = {
			num_of_revolts = 1
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA40050"
		prestige = 20
	}
}

### Filiki Eteria ###
country_event = {
	id = 40055
	title = "EVTNAME40055"
	desc = "EVTDESC40055"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1810
		any_owned_province = {
			culture = greek
			revolt_risk = 2
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA40055"
		any_owned = {
			limit = {
				culture = greek
				revolt_risk = 2
			}
			revolt_risk = 5
		}
	}
	option = {
		name = "EVTOPTB40055"
		add_country_modifier = {
			name = filiki_eteria
			duration = 365
		}
	}
}

### Hellenic School ###
country_event = {
	id = 40060
	title = "EVTNAME40060"
	desc = "EVTDESC40060"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1812
		2093 = { #Limassol
			owned_by = TUR
			controlled_by = TUR
		}
		2094 = { #Famagusta
			owned_by = TUR
			controlled_by = TUR
		}
		NOT = {
			has_country_modifier = hellenic_school
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPT_OK"
		add_country_modifier = {
			name = hellenic_school
			duration = 365
		}
	}
}

### First Serbian Uprising ###
country_event = {
	id = 40065
	title = "EVTNAME40065"
	desc = "EVTDESC40065"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		NOT = {
			exists = SRB
		}
		NOT = {
			year = 1813
		}
		any_owned_province = {
			culture = serbian
			revolt_risk = 2
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA40065"
		any_owned = {
			limit = {
				culture = serbian
			}
			add_province_modifier = {
				name = serbian_uprising
				duration = -1
			}
		}
	}
}

#Karadorde
country_event = {
	id = 40066
	title = "EVTNAME40066"
	desc = "EVTDESC40066"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		NOT = {
			exists = SRB
		}
		any_owned_province = {
			culture = serbian
			has_province_modifier = serbian_uprising
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA40066"
		random_owned = {
			limit = {
				culture = serbian
				has_province_modifier = serbian_uprising 
			}
			random_list = {
				10 = {}
				90 = {
					create_revolt = 5
				}
			}
		}
		random_owned = {
			limit = {
				culture = serbian
				has_province_modifier = serbian_uprising
			}
			random_list = {
				10 = {}
				90 = {
					create_revolt = 5
				}
			}
		}
		random_owned = {
			limit = {
				culture = serbian
				has_province_modifier = serbian_uprising
			}
			random_list = {
				10 = {}
				90 = {
					create_revolt = 5
				}
			}
		}
		random_owned = {
			limit = {
				culture = serbian
				has_province_modifier = serbian_uprising
			}
			random_list = {
				10 = {}
				90 = {
					create_revolt = 5
				}
			}
		}
		random_owned = {
			limit = {
				culture = serbian
				has_province_modifier = serbian_uprising
			}
			random_list = {
				10 = {}
				90 = {
					create_revolt = 5
				}
			}
		}
	}
}

#Serbian War of Independence
country_event = {
	id = 40067
	title = "EVTNAME40067"
	desc = "EVTDESC40067"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		any_owned_province = {
			culture = serbian
			has_province_modifier = serbian_uprising
			controlled_by = REB
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA40067"
		any_owned = {
			limit = {
				culture = serbian
				has_province_modifier = serbian_uprising
				controlled_by = REB
			}
			nationalism = 10
			create_revolt = 2
		}
	}
}

#Independent Serbia
country_event = {
	id = 40068
	title = "EVTNAME40068"
	desc = "EVTDESC40068"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		961 = { #Belgrade
			controlled_by = REB
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA40068"
		set_country_flag = serbia_flag
		961 = {
			nationalism = 10
			create_revolt = 5
		}
	}
}

#Serbia Defeated
country_event = {
	id = 40069
	title = "EVTNAME40069"
	desc = "EVTDESC40069"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		NOT = {
			exists = SRB
		}
		961 = { #Belgrade
			controlled_by = TUR
		}
		has_country_flag = serbia_flag
		any_owned_province = {
			has_province_modifier = serbian_uprising
			NOT = {
				num_of_revolts = 1
			}
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA40069"
		clr_country_flag = serbia_flag
		any_owned = {
			remove_province_modifier = serbian_uprising
		}
		any_controlled = {
			remove_province_modifier = serbian_uprising
		}
	}
}

### The Capture and Death of Antonis Katsantonis ###
country_event = {
	id = 40070
	title = "EVTNAME40070"
	desc = "EVTDESC40070"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1809
		any_owned_province = {
			culture = greek
			revolt_risk = 20
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA40070"
		random_owned = {
			limit = {
				culture = greek
			}
			revolt_risk = 10
		}		
	}
}

### Apostol Arsache ###
country_event = {
	id = 40075
	title = "EVTNAME40075"
	desc = "EVTDESC40075"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1807
		total_ideas = 5
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPT_OK"
		idea_points = 30
	}
}

### Manuc's Inn ###
country_event = {
	id = 40080
	title = "EVTNAME40080"
	desc = "EVTDESC40080"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1808
		OR = {
			1001 = {
				controlled_by = TUR
			}
			WAL = {
				OR = {
					vassal_of = TUR
					alliance_with = TUR
				}
				any_owned_province = {
					province_id = 1001
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPT_OK"
		idea_points = 25
	}
}

### The Enemy of Wallachia ###
country_event = {
	id = 40085
	title = "EVTNAME40085"
	desc = "EVTDESC40085"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		exists = WAL
		NOT = {
			year = 1808
		}
		1028 = {
			controlled_by = TUR
		}
		WAL = {
			OR = {
				vassal_of = TUR
				alliance_with = TUR
			}
		}
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPTA40085"
		1028 = {
			revolt_risk = 10
		}
		WAL = {
			relation = {
				who = TUR
				value = 30
			}
		}
	}
	option = {
		name = "EVTOPTB40085"
		WAL = {
			relation = {
				who = TUR
				value = -10
			}
		}
	}
}

### Kosmas Balanos ###
country_event = {
	id = 40090
	title = "EVTNAME40090"
	desc = "EVTDESC40090"
	
	fire_only_once = yes
	
	trigger = {
		tag = TUR
		year = 1808
		1070 = { #Ioanina
			controlled_by = TUR
		}
		total_ideas = 8
	}
	
	mean_time_to_happen = {
		months = 12
	}
	
	option = {
		name = "EVTOPT_OK"
		idea_points = 25
	}
}